package com.dhh.util.manager;

import java.util.List;

import android.util.Pair;

import com.dhh.dao.DataBaseHelper;
import com.dhh.dao.FoodDAO;
import com.dhh.vo.Food;

public class FoodManager {
	private FoodDAO dao;
	
	public FoodManager(DataBaseHelper db){
		dao = new FoodDAO(db);
	}
	
	public Food getFood(String id){
		return dao.getFoodByID(id);
	}
	
	public Pair<Boolean, List<Food>> getFoods(String foodGroup,String foodName,int page){
		List<Food> foods = dao.listFoods(foodGroup, foodName,page);
		return new Pair<Boolean, List<Food>>(foods.size()>0,foods); 
	}
	
	public boolean addFood(Food food){
		return dao.addFood(food);
	}
}
